/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
package SteamEngineDB;

import java.io.Serializable;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Jeff Bendixsen <jeff@westcoastcode.com>
 */
@Entity
@Table(name = "CAR_SEAT")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CarSeat.findAll", query = "SELECT c FROM CarSeat c"),
    @NamedQuery(name = "CarSeat.findById", query = "SELECT c FROM CarSeat c WHERE c.id = :id"),
    @NamedQuery(name = "CarSeat.findBySeatPosition", query = "SELECT c FROM CarSeat c WHERE c.seatPosition = :seatPosition"),
    @NamedQuery(name = "CarSeat.findBySeatCode", query = "SELECT c FROM CarSeat c WHERE c.seatCode = :seatCode"),
    @NamedQuery(name = "CarSeat.findByActive", query = "SELECT c FROM CarSeat c WHERE c.active = :active"),
    @NamedQuery(name = "CarSeat.findByWheelchair", query = "SELECT c FROM CarSeat c WHERE c.wheelchair = :wheelchair"),
    @NamedQuery(name = "CarSeat.findByCounted", query = "SELECT c FROM CarSeat c WHERE c.counted = :counted")})
public class CarSeat implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    @Column(name = "SEAT_POSITION")
    private Integer seatPosition;
    @Column(name = "SEAT_CODE")
    private String seatCode;
    @Basic(optional = false)
    @Column(name = "ACTIVE")
    private String active;
    @Basic(optional = false)
    @Column(name = "WHEELCHAIR")
    private String wheelchair;
    @Basic(optional = false)
    @Column(name = "COUNTED")
    private String counted;
    @JoinColumn(name = "CAR_ID", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private Car carId;

    public CarSeat() {
    }

    public CarSeat(Integer id) {
        this.id = id;
    }

    public CarSeat(Integer id, String active, String wheelchair, String counted) {
        this.id = id;
        this.active = active;
        this.wheelchair = wheelchair;
        this.counted = counted;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getSeatPosition() {
        return seatPosition;
    }

    public void setSeatPosition(Integer seatPosition) {
        this.seatPosition = seatPosition;
    }

    public String getSeatCode() {
        return seatCode;
    }

    public void setSeatCode(String seatCode) {
        this.seatCode = seatCode;
    }

    public String getActive() {
        return active;
    }

    public void setActive(String active) {
        this.active = active;
    }

    public String getWheelchair() {
        return wheelchair;
    }

    public void setWheelchair(String wheelchair) {
        this.wheelchair = wheelchair;
    }

    public String getCounted() {
        return counted;
    }

    public void setCounted(String counted) {
        this.counted = counted;
    }

    public Car getCarId() {
        return carId;
    }

    public void setCarId(Car carId) {
        this.carId = carId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CarSeat)) {
            return false;
        }
        CarSeat other = (CarSeat) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "SteamEngineDB.CarSeat[ id=" + id + " ]";
    }
    
}
